﻿using DotNetCore.MyBlogApi.Data.Attributes;
using DotNetCore.MyBlogApi.Data.Models.m2m_middle;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace DotNetCore.MyBlogApi.Data.Models
{
    [DBDescription("文章表")]
    public class Article
    {
        [DBDescription("文章ID")]
        [Key]
        public Guid ArticleId { get; set; }

        [DBDescription("文章名")]
        public string ArticleTitle { get; set; }
        [DBDescription("原文地址")]
        public string OriginUrl { get; set; }
        [DBDescription("原文作者")]
        public string ArticleAuthor { get; set; }
        [DBDescription("作者主页")]
        public string ArticleAuthorHomePage { get; set; }
        [DBDescription("发表时间")]
        public DateTime ArticlePubTime { get; set; }
        [DBDescription("文章入库时间")]
        public DateTime ArticleInTime { get; set; }
        [DBDescription("发布时所在IP")]
        public string ArticlePubIp { get; set; }
        [DBDescription("阅读数")]
        public int ArticleClick { get; set; }
        [DBDescription("评论数")]
        public int ArticleComment { get; set; }
        [DBDescription("文章的模式0：私有 1：公开 2：仅好友可见")]
        public int ArticleType { get; set; }
        [DBDescription("文章正文")]
        public string ArticleContent { get; set; }
        [DBDescription("文章概要")]
        public string ArticleGeneral { get; set; }
        [DBDescription("是否置顶")]
        public bool IsTop { get; set; }
        [DBDescription("是否删除")]
        public bool IsDelete { get; set; }

        [Timestamp]
        public byte[] Vsersion { get; set; }//版本标识

        //导航属性
        //[DBDescription("SysUser_Id 外键")]
        //public Guid SysUserId { get; set; }
        //public SysUser SysUser { get; set; }

        //[DBDescription("ArticleCategories 外键")]
        //[Required(AllowEmptyStrings = true)]
        //public Guid CateGoryId { get; set; }
        //public ArticleCategory ArticleCategory { get; set; }//文章所属分类


        //public ICollection<Article_ArticleTag> Article_ArticleTags { get; set; }//文章标签 多对多关系




        /// <summary>
        /// 构造函数
        /// </summary>
        public Article()
        {
            //Article_ArticleTags = new List<Article_ArticleTag>();
            IsDelete = false;
            IsTop = false;
        }
    }
}
